package com.sniper.serviceribbon.controller;

import com.sniper.serviceribbon.service.DbaUploadService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import java.util.Map;

/**
 * @author suzhen
 * @create 2018/3/27
 */
@RestController
public class UploadController {

    @Autowired
    private DbaUploadService uploadService;

    @RequestMapping(value = "upload", method = RequestMethod.POST)
    public Map<String, Object> upload(@RequestParam("imgFile") MultipartFile imgFile) {
        return uploadService.upload(imgFile);
    }
}
